package com.leezt.designpattern.principles.OCP.models;

import java.util.Objects;

public class AlertRule {
    public String api;
    public long maxTps;
    public long maxErrorCount;

    public AlertRule(String api, long maxTps, long maxErrorCount) {
        this.api = api;
        this.maxTps = maxTps;
        this.maxErrorCount = maxErrorCount;
    }

    public String getApi() {
        return api;
    }

    public long getMaxTps() {
        return maxTps;
    }

    public long getMaxErrorCount() {
        return maxErrorCount;
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof AlertRule rule)) {
            return false;
        }
        return Objects.equals(this.api, rule.api);
    }
}
